<div id="Removing-directories"></div>
<div class="header">
<p>
Next: [[cvs: Moving and renaming files#Moving and renaming files|Moving files]], Previous: [[cvs: Removing files#Removing files|Removing files]], Up: [[cvs: Adding, removing, and renaming files and directories#Adding, removing, and renaming files and directories|Adding and removing]] &nbsp; |[[cvs: Index#SEC_Contents|Contents]]||[[cvs: Index#Index|Index]]|</p>
</div>

----

<div id="Removing-directories-1"></div>
=== Removing directories ===
<div id="index-Removing-directories"></div>
<div id="index-Directories_002c-removing"></div>

In concept removing directories is somewhat similar to
removing files&mdash;you want the directory to not exist in
your current working directories, but you also want to
be able to retrieve old releases in which the directory
existed.

The way that you remove a directory is to remove all
the files in it.  You don&rsquo;t remove the directory
itself; there is no way to do that.
Instead you specify the &lsquo;<code>-P</code>&rsquo; option to
<code>cvs update</code> or <code>cvs checkout</code>,
which will cause <small>CVS</small> to remove empty
directories from working directories.
(Note that <code>cvs export</code> always removes empty directories.)
Probably the
best way to do this is to always specify &lsquo;<code>-P</code>&rsquo;; if
you want an empty directory then put a dummy file (for
example &lsquo;<tt>.keepme</tt>&rsquo;) in it to prevent &lsquo;<code>-P</code>&rsquo; from
removing it.

Note that &lsquo;<code>-P</code>&rsquo; is implied by the &lsquo;<code>-r</code>&rsquo; or &lsquo;<code>-D</code>&rsquo;
options of <code>checkout</code>.  This way
<small>CVS</small> will be able to correctly create the directory
or not depending on whether the particular version you
are checking out contains any files in that directory.

This document was generated on <i>a sunny day</i> using [http://www.nongnu.org/texi2html/ <i>texi2html</i>].
